package com.my.test.java.autocode.entiy;

import com.my.test.java.autocode.util.ACStringUtils;

public class ColumnBean {

	private String javaType;
	private String dbType;
	private String javaName;
	private String colName;
	private Long length;
	private boolean isPK = false;
	
	public ColumnBean(){}
	public ColumnBean(String javaType,String dbType,String colName,Long length){
		this.javaType = javaType;
		this.dbType = dbType;
		this.colName = colName;
		this.length = length;
		
		this.javaName = ACStringUtils.getJavaName(colName);
	}
	public ColumnBean(String javaType,String dbType,String colName,Long length,boolean isPK){
		this.javaType = javaType;
		if(dbType.indexOf("INT")>-1){
			this.dbType = "INTEGER";
		}else{
			this.dbType = dbType;
		}
		this.colName = colName;
		this.length = length;
		this.isPK = isPK;
		
		this.javaName = ACStringUtils.getJavaName(colName);
	}
	
	public String getJavaName() {
		return javaName;
	}
	public void setJavaName(String javaName) {
		this.javaName = javaName;
	}
	public boolean isPK() {
		return isPK;
	}
	public void setPK(boolean isPK) {
		this.isPK = isPK;
	}
	public String getJavaType() {
		return javaType;
	}
	public void setJavaType(String javaType) {
		this.javaType = javaType;
	}
	public String getDbType() {
		return dbType;
	}
	public void setDbType(String dbType) {
		this.dbType = dbType;
	}
	public String getColName() {
		return colName;
	}
	public void setColName(String colName) {
		this.colName = colName;
	}
	public Long getLength() {
		return length;
	}
	public void setLength(Long length) {
		this.length = length;
	}
}
